package main

import "fmt"

//定义一个包内全局字符串变量，下面语法正确的是（AB）
//A. var str string
//B. str := ""	//B 只支持局部变量声明
//C. str = ""	//C 是赋值，str 必须在这之前已经声明
//D. var str = ""

func main() {
	i := 5
	defer hello(i) //此时将5复制了，在defer中i的值不会改变
	i = i + 10

	//-------------------------------------------------
	t := Teacher{}
	t.ShowA() //showA showB
}
func hello(i int) {
	fmt.Println(i) //5
}

type People struct{}

func (p *People) ShowA() {
	fmt.Println("showA")
	p.ShowB()
}
func (p *People) ShowB() {
	fmt.Println("showB")
}

type Teacher struct {
	People
}

func (t *Teacher) ShowB() {
	fmt.Println("teacher showB")
}
